package com.itheima.d1_streamdemo;

import java.util.ArrayList;
import java.util.List;

/**
 * 学习Stream流
 */
public class Test {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        List<String> list2 = new ArrayList<>();
        List<String> list3 = new ArrayList<>();
        list.add("张无忌");
        list.add("张三丰");
        list.add("张强");
        list.add("周芷若");
        list.add("赵敏");
        System.out.println(list);
        for (String s : list) {
            if (s.startsWith("张")){
                list2.add(s);
            }
        }
        for (String s : list2) {
            if (s.length() == 3){
                list3.add(s);
            }
        }
        System.out.println(list3);
    }
}
